<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>GT pro钱包</title>
		<!-- Tell the browser to be responsive to screen width -->
		<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
		<!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->
		<!-- Bootstrap 3.3.7 -->
		<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
		<!-- Font Awesome -->
		<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
		<!-- Ionicons -->
		<link rel="stylesheet" href="bower_components/Ionicons/css/ionicons.min.css">
		<!-- DataTables -->
  		<link rel="stylesheet" href="bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
		<!-- Theme style -->
		<link rel="stylesheet" href="dist/css/AdminLTE.min.css">
		<link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
		<link rel="stylesheet" href="bower_components/jvectormap/jquery-jvectormap.css">
		<link rel="stylesheet" href="bower_components/bootstrap-daterangepicker/daterangepicker.css">
		<!-- bootstrap wysihtml5 - text editor -->
		<link rel="stylesheet" href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
		<link rel="stylesheet" href="css/card.css">
		<link rel="stylesheet" href="css/style.css">
		<link rel="stylesheet" href="bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
		<link rel="stylesheet" href="bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
		<script type="text/javascript" src="./libs/spark-md5-3.0.0.min.js"></script>
	    <script type="text/javascript" src="./libs/crypto-js.js"></script>
	    <script type="text/javascript" src="./libs/base64.min.js"></script>
	    <script type="text/javascript" src="./libs/ufile-token.js"></script>
	</head>
	</head>
	<style type="text/css">
		textarea{
			width: 100%;
			border: 1px solid #ddd;
			line-height: 24px;
			padding: 5px 10px;
			height: 350px;
		}
		#localImgBtn + .ke-upload-button{
			display: none;
		}
	</style>
	<body class="hold-transition skin-blue sidebar-mini">
		<div class="wrapper">
			<div class="content-wrapper">
				<section class="content">
					<div class="row box" style="margin: 0;">
						<div class="col-sm-12" style="margin: 10px 0;padding: 0;">
							<label class="margin-bottom-none col-xs-3" style="font-weight: normal;line-height: 2;min-width: 200px;">标题：
								<input type="text" class="form-control" id="title" name="title"/>
							</label>
						</div>
						<div class="col-sm-12" style="padding: 0;">
							<label class="margin-bottom-none col-xs-12" style="font-weight: normal;line-height: 2;min-width: 200px;">内容
								<textarea rows="10" class="form-control" id="editor" name="data"></textarea>
							</label>
						</div>
						<div class="col-sm-12" style="margin: 10px 0">
							<button class="btn bg-orange margin-r-5" id="save" onclick="operation()">保存</button>
						</div>
					</div>
				</section>
				<!-- /.content -->
			</div>
		</div>
		<!-- ./wrapper -->

		<!-- jQuery 3 -->
		<script src="bower_components/jquery/dist/jquery.min.js"></script>
		<!-- jQuery UI 1.11.4 -->
		<script src="bower_components/jquery-ui/jquery-ui.min.js"></script>
		<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
		<script>
			$.widget.bridge('uibutton', $.ui.button);
		</script>
		<!-- Bootstrap 3.3.7 -->
		<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
		<!-- Morris.js charts -->
		<script src="bower_components/raphael/raphael.min.js"></script>
		<script src="bower_components/moment/min/moment.min.js"></script>
		<script src="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
		<!-- Slimscroll -->
		<script src="bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
		<!-- FastClick -->
		<script src="bower_components/fastclick/lib/fastclick.js"></script>
		<!-- AdminLTE App -->
		<script src="dist/js/adminlte.min.js"></script>
		<!-- AdminLTE for demo purposes -->
		<script src="dist/js/demo.js"></script>
		<script src="bower_components/chart.js/Chart.js"></script>
		<script src="bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
		<script src="bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
		<script charset="utf-8" src="kindeditor/kindeditor-all.js"></script>
		<script charset="utf-8" src="kindeditor/lang/zh-CN.js"></script>
		<script src="js/argument.js"></script>
		<script src="js/fun.js"></script>
		<script src="js/nav.js"></script>
		<script src="js/pop.js"></script>
		
		<script type="text/javascript">
			function error(res){
				alert('接口报错')
				console.log(res)
				$("#loading").hide()
			}
			
			$(".sidebar a[href='notice_list.html']").parent().addClass('active')
			$(".sidebar a[href='notice_list.html']").parent().parent().parent().addClass('active')
			//操作，0为添加，1为编辑
			function operation(){
				var Json = {
						title:$("#title").val(),
						content:$("#editor").val().replace(/\n/g, "<br/>"),
					};
					
					$.ajax({
						type:"post",
						url:url+"Back_NoticeAdd",
						"headers": {
							"auth-token": localStorage.getItem("wallet_token")
						},
						async:true,
						data:{
							data:JSON.stringify(Json),
						},
						"contentType": "application/x-www-form-urlencoded",
						success:function(res){
							if(res.status==1000||res.status==102){
								ToLogin(res)
							}else  if(res.status==1){
								alert("添加成功")
								location.href = 'notice_list.html'
							}else{
								alert(res.msg)
							}
						},error:function(res){
							error(res)
						}
					});
			}
			
	</script>
	</body>
	
</html>